import { Button, Form, Input, ResultPage, Tabs } from 'antd-mobile'
import { useNavigate } from 'react-router-dom'
// import React from 'react'

const Home = () => {
    const nav= useNavigate()
   const onFinish = (values) => {
    console.log(values);
     nav("/list",{state:values})
  }

    return (
        <div>
            <Tabs>
                <Tabs.Tab title='机票' key='fruits'>
                    机票
                </Tabs.Tab>
                <Tabs.Tab title='国内火车' key='vegetables'>
                    <ResultPage
                        status=''
                        title=''
                        description=''
                    >
                        <ResultPage.Card style={{ height: 280, padding: 8 }}>
                             <Form
                               onFinish={onFinish}
                                    footer={
                                        <Button block type='submit' color='warning' size='large'>
                                            查询
                                        </Button>
                                    }
                                >
                                    <Form.Item name='start' label='出发'>
                                        <Input></Input>
                                    </Form.Item>
                                    <Form.Item name='end' label='到达'>
                                        <Input></Input>
                                    </Form.Item>
                                </Form>
                        </ResultPage.Card>


                    </ResultPage>
                </Tabs.Tab>
                <Tabs.Tab title='国际/港台' key='gjgt'>
                    国际/港台
                </Tabs.Tab>
                <Tabs.Tab title='汽车票' key='qcp'>
                    汽车票
                </Tabs.Tab>
            </Tabs>

        </div>
    )
}

export default Home
